this._screenSaverDBus = new ShellDBus.ScreenSaverDBus(this);
this._inhibitor = null;
+ this._aboutToSuspend = false;
this._loginManager = LoginManager.getLoginManager();
this._loginManager.connect('prepare-for-sleep',
Lang.bind(this, this._prepareForSleep));
},
_prepareForSleep: function(loginManager, aboutToSuspend) {
+ this._aboutToSuspend = aboutToSuspend;
+
if (aboutToSuspend) {
if (!this._settings.get_boolean(LOCK_ENABLED_KEY)) {
this._uninhibitSuspend();
if (prevIsActive != this._isActive)
this.emit('active-changed');
- this._uninhibitSuspend();
+ if (this._aboutToSuspend)
+ this._uninhibitSuspend();
this.emit('lock-screen-shown');
},